/**
 * 
 */
package org.cuatrovientos.dice;

import java.util.Random;

/**
 * @author Isma
 *
 */
public class dice {

	/**
	 * attribute for the number of sizes
	 * @param args
	 */
	private int sides=0;
	/**
	 * attribute for have 0 in the dice
	 * @param args
	 */
	private boolean zeroYes = true;
	/**
	 * constructor that give value six to sides
	 */
	public dice (){
		this.sides = 6;
	}
	/**
	 * constructor that give value "x" to sides
	 * @param sides
	 */
	public dice (int sides){
		this.sides = sides;
	}
	/**
	 * constructor that give value "x" to sides and ask if number 0 is include in the dice
	 * @param sides
	 * @param zeroYes
	 */
	
	public dice (int sides, boolean zeroYes){
			this.sides = sides;
			this.zeroYes = zeroYes;
	}
	/**
	 * constructor that roll the dice, it generate a random number equal to the number of sides
	 * @return
	 */
	public int rollTheDice (){
		Random rnd = new Random();
		int num = 0;
		num = rnd.nextInt(sides);
		if (zeroYes) {
			return num;
		} else {
			return num + 1;
		}
		
	}
	/**
	 * main to teste the program
	 * @param args
	 */
	public static void main(String[] args) {
		dice diceOne = new dice();
		dice diceTwo = new dice(10);
		dice diceThree = new dice(12,false);
		
		for (int i=0;i<20;i++){
			System.out.print(diceOne.rollTheDice());
		}
		System.out.println("");
		for (int i=0;i<20;i++){
			System.out.print(diceTwo.rollTheDice());
		}	
		System.out.println("");
		for (int i=0;i<20;i++){
			System.out.print(diceThree.rollTheDice());
		}
		
		
	}

}
